# -*- coding: utf-8 -*-
"""
@Time ： 2023/1/5 14:49
@Author ： PJC
"""

from api.client import HttpClient
from common.read_yaml import get_yaml
from common.read_config import Environ
from common.read_token import read_token
from common.route import findalluserbypage

# print(findalluserbypage['case_data'])
data = get_yaml(Environ=Environ)


# print(data)


class UserManageApi(HttpClient):
    def find_all_user_by_page(self, body, token=""):
        url = self.get_full_url(findalluserbypage['url'])
        return self.send(url, body=body, method=findalluserbypage['method'],
                         x_token=token)
# class UserManageApi(HttpClient):
#     def __init__(self, token_name):
#         super().__init__()
#         token = read_token(token_name)
#         self.token = token
#
#     def find_all_user_by_page(self, body):
#         url = self.get_full_url(findalluserbypage['url'])
#         return self.send(url, body=body, method=findalluserbypage['method'],
#                          x_token=self.token)


# print(UserManageApi('lisi').find_all_user_by_page())
if __name__ == '__main__':
    a = UserManageApi('lisi_token')
    print(a.find_all_user_by_page(findalluserbypage['case_data'][0]['body']))
